package com.example.ivory.accountbook.Activity;


import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.CalendarView;
import android.widget.Toast;

import com.example.ivory.accountbook.R;

import de.greenrobot.event.EventBus;

public class calendarActivity extends AppCompatActivity {
    //创建calendar对象
    CalendarView calendarviewSelectDate;
    Intent intentCalendar;
    int []intDateData;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        intentCalendar = new Intent();
        intDateData = new int[3];
        super.onCreate(savedInstanceState);
        setContentView(R.layout.calendar);
        Send();
    }


    public void Send(){
        calendarviewSelectDate= (CalendarView) findViewById(R.id.calendarView);
        calendarviewSelectDate.setOnDateChangeListener(
                new CalendarView.OnDateChangeListener() {
                    @Override
                    public void onSelectedDayChange(CalendarView arg0, int arg1,
                                                    int arg2, int arg3) {
                        arg2 = arg2 + 1;
                        EventBus.getDefault().post(new FirstEvent(arg1+"-"+arg2+"-"+arg3));

                    }
                });
    }

}
